// components/b-tabs/b-tab-panel/b-tab-panel.js
Component({
	options: {
		multipleSlots: true,
		"styleIsolation": "apply-shared"
	},
	relations: {
		'/components/b-tabs/b-tab/b-tab': {
			type: 'parent'
		}
	},
	properties: {
		label: { // 标题
			type: String,
			value: ''
		},
		value: { // 唯一id
			type: null,
			value: null
		}
	},

	/**
	 * 组件的初始数据
	 */
	data: {
		visible: true
	},

	/**
	 * 组件的方法列表
	 */
	methods: {
		// 修改pickValue
		changePickValue: function(){
			const node = this.getRelationNodes('/components/b-tabs/b-tab/b-tab')
			this.setData({
				visible: node[0].data.pickValue === this.data.value
			})
		}
	},

	ready(){
		this.changePickValue()
	}
})